﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;


/// <summary>
/// 武器库（切换武器，暴走，。。。）
/// </summary>
public abstract class HGunManager  :MonoBehaviour
{
    protected HGun[] guns;
    protected HGun curGun;
    public int index = 0;

    public virtual void Awake()
    {
        guns = GetComponentsInChildren<HGun>();
        SetGun(index);
    }

    public void SetGun(int index)
    {
        curGun = guns[index];
    }

    public void NextGun()
    {
        index++;
        if (index >= guns.Length)
        {
            index = 0;
        }
        SetGun(index);
    }
}
